package com.action.UploadAction;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

import com.file.util.Upload;
import com.opensymphony.xwork2.ActionSupport;


public class UploadAction extends ActionSupport {
	private List<File> file;
	private List<String> fileFileName;
	private List<String> fileContentType;

	public List<File> getFile() {
		return file;
	}

	public void setFile(List<File> file) {
		this.file = file;
	}

	public List<String> getFileFileName() {
		return fileFileName;
	}

	public void setFileFileName(List<String> fileFileName) {
		this.fileFileName = fileFileName;
	}

	public List<String> getFileContentType() {
		return fileContentType;
	}

	public void setFileContentType(List<String> fileContentType) {
		this.fileContentType = fileContentType;
	}

	@Override
	public String execute() throws Exception {
		Upload upload = new Upload();
		ArrayList list = upload.upload(file, this.getFileFileName(), "/files/");
		if (list.size() > 0) {
			return SUCCESS;
		}else {
			return INPUT;
		}
	}
}